import request from '@/utils/request'
// 获取用户列表
export const getUserListApi = params => {
    return request({
        method: 'get',
        url: 'users',
        params
    })
}
// 添加用户
export const addUserApi = data => {
    return request({
        method: 'post',
        url: 'users',
        data
    })
}
// 编辑用户
export const editUserApi = data => {
    return request({
        method: 'put',
        url: 'users/' + data.id,
        data
    })
}
// 删除用户
export const delUserApi = id => {
    return request({
        method: 'delete',
        url: 'users/' + id,
    })
}

// 获取用户详情
export const getUserInfoApi = (id) => {
    return request({
        method: 'get',
        url: 'users/' + id,

    })
}

// 获取权限列表
export const getPermissionListApi = params => {
    return request({
        url: 'permissions',
        params
    })
}

// 获取日志列表
export const getLogListApi = () => {
    return request({
        method: 'post',
        url: 'frame/profile',

    })
}
// 获取菜单列表
export const getMenuListApi = () => {
    return request({
        method: 'get',
        url: 'menus',

    })
}
// 添加菜单
export const addMenuApi = (data) => {
    return request({
        method: 'post',
        url: 'menus',
        data

    })
}
// 修改菜单
export const editMenuApi = (data) => {
    return request({
        method: 'put',
        url: `menus/${data.id}`,
        data

    })
}
// 获取菜单详情
export const getMenuInfoApi = (id) => {
    return request({
        method: 'get',
        url: 'menus/' + id,

    })
}

// 删除菜单
export const delMenuApi = id => {
    return request({
        method: 'delete',
        url: 'menus/' + id,
    })
}

